<script setup lang="ts">
const props = defineProps({
  info: {
    type: String,
    required: true,
  },
  money: {
    type: Number,
    default: 0,
  },
});
const update = () => {
  // props.money*=2; // props 是只读的！
  console.log(props);
};
</script>
<template>
  <div class="son">
    <h1>我是子组件：曹植</h1>
    <div>{{ props.info }}, {{ props.money }}</div>
    <!-- 模板中，可以省略 `props`-->
    <!-- <div>{{ info }}, {{ money }}</div> -->
    <button @click="update">修改props数据</button>
  </div>
</template>

<style scoped>
.son {
  width: 400px;
  height: 200px;
  background: hotpink;
  padding: 0.5rem;
}
</style>
